package org.json.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.json.custom.CustomAnnotation;
import org.json.custom.CustomJsonDeserializer;
import org.json.custom.CustomJsonSerializer;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author yexi
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@CustomAnnotation
public class User {
    private String name;
    private int age;
    private String phone;
    @JsonSerialize(using = CustomJsonSerializer.class)
    @JsonDeserialize(using = CustomJsonDeserializer.class)
    private Date date;
    private Date date2;
    @JsonFormat(pattern = "yyyy年MM月dd日 HH时mm分ss秒")
    private LocalDateTime dateTime;
}